package com.example.reggie.common;

import org.springframework.stereotype.Component;

@Component
public class BaseContext {
//    ThreadLocal差不多给改线程创建一个副本可以把值放进去,只能由本线程访问其内容
    private static ThreadLocal<Object> threadLocal=new ThreadLocal<Object>();

    public  static Object getThreadLocal() {
       return threadLocal.get();
    }

    public static void setThreadLocal(Object l) {
        threadLocal.set(l);
    }
}
